import {getAllProCityArea} from 'network/site'

export default {
  state: {
    province: []
  },
  mutations: {
    setProvince(state,payload) {
      state.province = payload
    }
  },
  actions: {
    setProvince({ commit, state }) {
      if(state.province.length < 1) {
        getAllProCityArea().then(res => {
          commit('setProvince',res)
        }).catch(err => {
          console.log(err)
        })
      }
    }
  }
}